
import Vue from 'vue';
import Router from 'vue-router';

import ProjectRouters from '../modules/projectmgmt/projectmgmt.router';
import UserRouters from '../modules/usermgmt/usermgmt.router';

import {RouterAuthHook} from '../interceptors/router-auth.hook';

Vue.use(Router);

let router = new Router({routes: [...UserRouters, ...ProjectRouters].concat([{
	path: '/',
	name: 'Hello000',
	component: resolve => require(['@/components/Hello'], resolve)
}])});

router.beforeEach(RouterAuthHook);

function GlobalRouterPlugin () {}
GlobalRouterPlugin.install = function (Vue, options) {

	Vue.getRouter = function () {
		return router;
	};
};

Vue.use(GlobalRouterPlugin);


export {router};
